﻿@model SportsStore.WebUI.Models.EditProductModel
@{
ViewBag.Title = "Admin: Edit " + @Model.Name;
Layout = "~/Views/Shared/_AdminLayout.cshtml";
}
<h1>Edit @Model.Name</h1>

@using (Html.BeginForm("Edit", "Admin",
    FormMethod.Post, new { enctype = "multipart/form-data" })) {
    @Html.EditorForModel()
    <br />
    @Html.CategoryDropDownList(Model.Category)
    @Html.TexboxBruno("Category", "Category", (Model.Category != null ? Model.Category.Description : String.Empty))
    <br />
    <div class="editor-label">Image</div>
    <div class="editor-field">
    @if (Model.ImageData == null)
    {
    @:None
    }
    else
    {
    <img width="150" height="150" src="@Url.Action("GetImage", "Product", new { Model.ProductID })" />
    }
    
    <div>Upload new image: <input type="file" name="Image" /></div>
    </div>
    
    <input type="submit" value="Save" />
    @Html.ActionLink("Cancel and return to List", "Index")
    
    
    
}
